//
//  ZZLCLoginCell.m
//  ZZLC
//
//  Created by 杨春至 on 2017/12/14.
//  Copyright © 2017年 ZhongZeng. All rights reserved.
//

#import "ZZLCLoginCell.h"

@implementation ZZLCLoginCell

- (void)awakeFromNib {
    [super awakeFromNib];
    UIButton *eyeBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 30, 30)];
    [eyeBtn setImage:UIImageMake(@"closeeye") forState:UIControlStateNormal];
    
    [eyeBtn bk_addEventHandler:^(id sender) {
        _inputPwdTF.secureTextEntry = !_inputPwdTF.secureTextEntry;
        [eyeBtn setImage:_inputPwdTF.secureTextEntry?UIImageMake(@"closeeye"):UIImageMake(@"openeye") forState:UIControlStateNormal];
    } forControlEvents:UIControlEventTouchUpInside];
    
//    _inputPwdTF.rightView = eyeBtn;
    [self addSubview:eyeBtn];
    [eyeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(_inputPwdTF);
        make.bottom.equalTo(_inputPwdTF);
        make.left.equalTo(_inputPwdTF.mas_right);
        make.width.equalTo(_inputPhoneTF.mas_height);
    }];
    _inputPwdTF.rightViewMode = UITextFieldViewModeAlways;
    _inputPwdTF.secureTextEntry = YES;
    _inputPwdTF.clearButtonMode = _inputPhoneTF.clearButtonMode = UITextFieldViewModeAlways;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
